package com.cantuaria.jsf.util;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;

import org.apache.log4j.PropertyConfigurator;

/*
 * @Autor: Flávio CANTUÁRIA
 */


public class Log4jInit extends HttpServlet {
	private static final long serialVersionUID = 1L;
       
	@Override
	public void init() throws ServletException {
	    String prefix =  getServletContext().getRealPath("/");
	    String file = getInitParameter("log4j-init-file");
	    if(file != null) {
	      PropertyConfigurator.configure(prefix+file);
	    }
	}

}
